package com.mengtian_tech.tju.dataquery.api.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/v1/")
public class MockPlateQueryControoler {
	
	@RequestMapping("rec")
	public Object rec() throws InterruptedException {
		
		Thread.sleep(1500);
		
		Map<String,Object> map = new HashMap<String, Object>();
		Map<String,Object> result = new HashMap<String, Object>();
		map.put("result",result);
		
		List<Map<String,Object>> plate_list = new ArrayList<Map<String,Object>>();
		Map<String,Object> code = new HashMap<String, Object>();
		code.put("code", "湘G60009");
		
		Random r = new Random();
		if(r.nextInt(10) < 6) {
			plate_list.add(code);
		}
		
		
		result.put("plate_list", plate_list);
		
		return map;
	}
}
